<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateUsersTable extends Migration
{

  /**
   * Run the migrations.
   *
   * @return void
   */
  public function up()
  {
    Schema::create('users', function (Blueprint $table) {
      $table->increments('id');
      $table->string('name', 32)->unique();  // 用户名
      $table->string('email');     // 用户邮箱
      $table->string('password', 60);        // 密码
      $table->string('phone', 32);           // 联系电话
      $table->string('real_name', 32);       // 真实姓名
      $table->tinyInteger('is_admin');       // 是否管理员
      $table->rememberToken();
      $table->nullableTimestamps();
    });
  }

  /**
   * Reverse the migrations.
   *
   * @return void
   */
  public function down()
  {
    Schema::dropIfExists('users');
  }

}
